package com.boot.controller.blog;

import com.boot.controller.BaseController;
import com.boot.until.FileUpload;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
 * 文件上传专用
 */
@RestController
@RequestMapping("file")
public class FileController extends BaseController {

    /**
     * 文件上传测试
     * @param request
     * @param file
     * @return
     */
    @RequestMapping(value = "upload")
    public String FileUpload(HttpServletRequest request, MultipartFile file){
       String url= FileUpload.upload ( file,request );
       return success (url);
    }


}
